
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Selecting a data source </TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp163.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp165.htm" >Next</A>
<!-- End Header -->
<A NAME="CFHDGEIA"></A><h1>Selecting a data source </h1>
<A NAME="TI4963"></A><p>The data source you choose determines how you select the data
that will be used in the DataWindow object.</p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>About the term <i>data source</i></span> <A NAME="TI4964"></A>The term <i>data source</i> used here refers
to how you use the DataWindow painter to specify the data to retrieve into
the DataWindow object. Data source can also refer to where the data comes
from, such as a SQL Anywhere data source (meaning a database file) or
an XML data source (meaning an XML file). <i>Connecting to
Your Database</i>
 uses the term data source in this second
sense.</p>
<A NAME="TI4965"></A><h4>If the data is in the database </h4>
<A NAME="TI4966"></A><p>If the data for the DataWindow object will be retrieved from a database,
choose one of the data sources from <A HREF="pbugp164.htm#CDCBHHFE">Table 18-2</A>.</p>
<A NAME="CDCBHHFE"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 18-2: Data source choices for data
from a database</caption>
<tr><th  rowspan="1"  ><A NAME="TI4967"></A>Data source</th>
<th  rowspan="1"  ><A NAME="TI4968"></A>Use when</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4969"></A>Quick Select</td>
<td  rowspan="1"  ><A NAME="TI4970"></A>The data is from a single table (or from
tables that are related through foreign keys) and you need only
to choose columns, selection criteria, and sorting. </td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4971"></A><ACRONYM title = "sequel" >SQL</ACRONYM> Select</td>
<td  rowspan="1"  ><A NAME="TI4972"></A>You want more control over the <ACRONYM title = "sequel" >SQL</ACRONYM> <b>SELECT</b> statement generated
for the data source <i>or</i> your data is from tables
that are not connected through a key. For example, you need to specify
grouping, computed columns, or retrieval arguments within the <ACRONYM title = "sequel" >SQL</ACRONYM> <b>SELECT</b> statement.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4973"></A>Query</td>
<td  rowspan="1"  ><A NAME="TI4974"></A>The data has been defined as a query.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4975"></A>Stored Procedure</td>
<td  rowspan="1"  ><A NAME="TI4976"></A>The data is defined in a stored procedure.</td>
</tr>
</table>
<A NAME="TI4977"></A><h4>If the data is not in a database </h4>
<p><b>Web Service data source</b>   Select the Web Service data source if you want to populate
the DataWindow object with data you obtain from a Web service.</p>
<A NAME="TI4978"></A><p>For more information, see <A HREF="pbugp170.htm#CDCEEAJHWS">"Using a Web service data
source"</A>.</p>
<p><b>External data source</b>   Select the External data source if:<A NAME="TI4979"></A>
<ul>
<li class=fi>The DataWindow object will be populated
programmatically.</li>
<li class=ds>Data will be imported from a DDE application.</li>
<li class=ds>Data will be imported from an external file, such
as an XML, comma-separated values (CSV), tab-separated
text (TXT), or dBASE (DBF) file.
</li>
</ul>
</p>
<A NAME="TI4980"></A><p>You can also use an ODBC driver to access data from a file. </p>
<A NAME="TI4981"></A><p>For more information, see <i>Connecting
to Your Database.</i>
</p>
<A NAME="TI4982"></A><p>After you choose a data source in the various DataWindow wizards,
you specify the data. The data source you choose determines what
displays in the wizards and how you define the data.</p>
<A NAME="TI4983"></A><h4>Why use a DataWindow if the data is not from
a DBMS</h4>
<A NAME="TI4984"></A><p>Even when the data is not coming from the database, there
are many times when you want to take advantage of the intelligence
of a DataWindow object:<A NAME="TI4985"></A>
<ul>
<li class=fi><b>Data Validation</b>   You have full access to validation rules for data</li>
<li class=ds><b>Display Formats</b>   You can use any existing display formats to present the data,
or create your own</li>
<li class=ds><b>Edit Styles</b>   You can use any existing edit styles, such as radio buttons and
edit masks, to present the data, or create your own
</li>
</ul>
</p>

